<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Description of member_model
 * 
 * @author Subha Sundar Das (subhasundar.das@gmail.com)
 */
class Admin_membership_model extends CI_Model {

    function __construct() {
        parent::__construct();
        log_message('debug', 'Model Initialized');
    }
    
    function showlist() {
    	$query = $this->db->get('membership');
    	$result = $query->result();
    	return $result;
    }
    
    function membership_name($param) {
    	$this->db->where('code', $param);
    	$query = $this->db->get('membership');
    	$result = $query->result();
    	$row = $query->row();
    	return $row->name;
    }
    
    function membership_facility($mem_id) {
    	//--Get Listing Membership Code
    
    	$this->db->where('code', $mem_id);
    	$this->db->limit(1);
    	$query = $this->db->get('membership');
    	$result = $query->result();
    
    	if ($query->num_rows() > 0) {
    		return $query->row();
    	}
    }
    
    function get_membership_code() {
    	$query = $this->db->get('membership');
    	$result = $query->result();
    	return $result;
    }
    
    function get_memtypeinfo_byid($id=NULL) {
    	$this->db->where('id', $id);
    	$query = $this->db->get('membership');
    	$result = $query->result();
    	return $result;
    }
    
    
}